#设置cmake最低版本
cmake_minimum_required(VERSION 3.4.1)

#设置项目名称
project(tst_qtconnectivity_auto)

#引入add_module模板文件
include(${ISSQTTESTROOTDIR}/cmake/add_module.cmake)

#设置测试类型，auto为自动测试，manual为手动测试,即test目录下的文件夹名
set(TEST_TYPE auto)
#设置模块名
set(MODULE qtconnectivity)
#设置需要链接的模块
set(LinkQt Core Widgets Concurrent Bluetooth Nfc OhExtras)
#设置需要链接的模块的私有模块
set(LinkQtPrivate Bluetooth Nfc)

add_definitions(-DSRCDIR1="${ROOT_DIR}/${MODULE}/tests/${TEST_TYPE}/nfcdata")
add_definitions(-DSRCDIR2="${ROOT_DIR}/${MODULE}/tests/${TEST_TYPE}/qnearfieldtagtype2/nfcdata")
set(EXCLUDE
    #private test
    qnearfieldmanager
    qnearfieldtagtype1
    qnearfieldtagtype2
    qbluetoothsocket                #SIGSEGV(SEGV_MAPERR)(QScopedPointer<QOpenHarmonyJsObjectPrivate, QScopedPointerDeleter<QOpenHarmonyJsObjectPrivate>>::operator->() const)
    qlowenergycontroller              #SIGSEGV(SEGV_MAPERR)(QScopedPointer<QOpenHarmonyJsObjectPrivate, QScopedPointerDeleter<QOpenHarmonyJsObjectPrivate>>::operator->() const)
    qlowenergycontroller-gattserver #SIGSEGV(SEGV_MAPERR)(QScopedPointer<QOpenHarmonyJsObjectPrivate, QScopedPointerDeleter<QOpenHarmonyJsObjectPrivate>>::operator->() const)
)

set(EXCLUDE_SRC ${EXCLUDE_SRC}
    qlowenergycontroller-gattserver/server/qlowenergycontroller-gattserver.cpp
)

add_sources(openharmonyPermissionHandle/permissionHandle.cpp)


#寻找指定测试类型的所有测试项，即auto目录下的所有测试项
find_all(TEST_ITEMS)
set(PLUGINS QOpenHarmonyPlatformIntegrationPlugin)




if(DEFINED TEST_ITEMS)
    create_library(${TEST_ITEMS})
endif()




